/**
 * Created with JetBrains WebStorm.
 * User: Administrator
 * Date: 15-10-15
 * Time: 下午2:26
 * To change this template use File | Settings | File Templates.
 */
window.onload=function(){
    var shopId = $.getUrlParam("shopId");
    var url = getUrl();
    $.jsonp({
        url: 'http://'+url+'/api/supplier/shop_detail_list-'+shopId,
        data: {},
        callbackParameter: "callback",
        success: function (data, textStatus, xOptions) {
            $(".bacim").attr('style','background-image:url('+data.shops.cover+')');

            var telphone = data.shops.telphone;
            data.shops.distance = $.getUrlParam("distance");
            $("#telphone").attr("href","tel:"+data.shops.telphone);
            $("#tel").text(telphone);
            var address = data.shops.address;
            $("#address").text(address);
            var complied_tpl = juicer($("#sj_detail_tpl").text());
            var html = complied_tpl.render(data);
            $(".order-list").append(html);
            var complied_tpl01 = juicer($("#sj_detail_tpl01").text());
            var html01 = complied_tpl01.render(data);
            $("#store01").append(html01);

            var complied_tpl03 = juicer($("#sj_detail_tpl03").text());
            var html03 = complied_tpl03.render(data);
            $("#store03").append(html03);
        },
        error: function (xOptions, textStatus) {
        }
    });
}